package com.samphanie.security.security.service.impl;

import com.samphanie.security.security.service.UserDetailsExtensionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;

/**
 * @author Dries
 * @email 1451691457@qq.com
 */
@Slf4j
public class DefaultUserDetailServiceImpl implements UserDetailsExtensionService {

    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        log.warn("请配置 UserDetailsService 接口的实现.");
        throw new UsernameNotFoundException(username);
    }

    /**
     * 根据手机号登录
     *
     * @param mobile
     * @return UserDetails
     * @throws UsernameNotFoundException
     */
    @Override
    public UserDetails loadUserByMobile(String mobile) throws UsernameNotFoundException {
        log.warn("请配置 UserDetailsService 接口的实现.");
        throw new UsernameNotFoundException(mobile);
    }

    /**
     * 根据社交账号登录
     *
     * @param openId 第三方的绑定的openId
     * @return UserDetails
     * @throws UsernameNotFoundException
     */
    @Override
    public UserDetails loadUserBySocial(String openId) throws UsernameNotFoundException {
        log.warn("请配置 UserDetailsService 接口的实现.");
        throw new UsernameNotFoundException(openId);
    }
}
